My-revealjs Example

Your Name

Your Institution

Your Name

Your Institution

A

Table of Contents

  • A

  • B

  • C

  • D

a

asdpjaspdi jasd asdj apisdj apisd

aa

B

Table of Contents

  • A

  • B

  • C

  • D

psdjpai djpaidjw

aidj pwaidj apwdij awdp

b

jaspid jawpidjwpi djw

bb

asdas dad

for i in range(5):
  print(i)
0
1
2
3
4
import time
for i in range(2):
  time.sleep(3)

C

Table of Contents

  • A

  • B

  • C

  • D

cc

  1. asd asdas d

  2. d ajwdpiw jdpawidj pw d

    • asdasd asip dji p
    • jdipaj wdpiwj diaw dw \begin{aligned} f(x) = y. \end{aligned}

Theorem 1 (ASD) aspdjaspid jsapi d.

See Theorem 1.

D

Table of Contents

  • A

  • B

  • C

  • D

d

  • asdas d
  • sadj paisdjpai d
  • asd jawpdi jwiadpj w
  • asdas d
  • sadj paisdjpai d
  • asd jawpdi jwiadpj w

dd

  • dddd
%matplotlib inline
import numpy as np
import torch
from torch import nn

from ipywidgets import interactive
import matplotlib.pyplot as plt

m = 16
W1 = nn.Linear(1,m)
W1.weight.requires_grad = False

W2 = nn.Linear(m,m)
W2.weight.requires_grad = False
W2.bias.requires_grad = False

Wn = nn.Linear(m,m)
Wn.weight.requires_grad = False

sigR = nn.ReLU()
sigS = nn.Sigmoid()

Net = nn.Sequential(
  W1, sigR,
  nn.Linear(m,m), sigR,
  W2, sigR,
  nn.Linear(m,m), sigR,
  Wn, sigR,
  nn.Linear(m,1),
)

def f(w11=2.0, w21=-1.0, b21=1, wn1=2.0, b=0.0):  
  W1.weight[0,0] = torch.tensor([w11])
  W2.weight[0,0] = torch.tensor([w21])
  W2.bias[0] = torch.tensor([b21])
  Wn.weight[0,0] = torch.tensor([wn1])
  
  plt.figure(2)
  x = np.linspace(-16, 16, num=600)
  y = torch.zeros_like(torch.zeros(len(x)))
  x_torch = torch.from_numpy(x).to(torch.float32)
  # np.linspace(-10, 10, num=100000)
  for j in range(len(x_torch)):
    y[j] = Net(x_torch[j:j+1])
  y = y.detach().numpy() + b
  # print(x[:16])
  print(y[:16])
  plt.plot(x, y)
  plt.ylim(-1, 1)
  plt.show()

interactive_plot = interactive(f, w11 = (-10.0, 10.0),
                                  w21 = (-10.0, 10.0),
                                  b21 = (-20.0, 20.0),
                                  wn1 = (-10.0, 10.0),
                                  b = (-20.0, 20.0)
                                  )
output = interactive_plot.children[-1]
output.layout.height = '500px'
interactive_plot